<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<%@ taglib prefix="sec"
	uri="http://www.springframework.org/security/tags"%>

<s:include value="../header.jsp"></s:include>
<s:include value="../leftNav.jsp"></s:include>

<div id="content">

<div id="tabs">
	<ul>
		<li><s:a href="#tabs-1" action="testActionJsp.action">Customers list</s:a></li>
	</ul>
	<div id="tabs-1">
		<s:if test="users.size > 0">
			<table id="users">
				<tr style="background-color: highlight;">
					<td>id</td>
					<td>Username</td>
					<td>Firstname</td>
					<td>Lastname</td>
					<td>Email</td>
					<td>Phone</td>
					<td>Last visit</td>
				</tr>
				<s:iterator value="users" status="usersStatus">
					<s:if test="#usersStatus.even == true">
						<tr style="background-color: silver;">
							<td>
								<s:url id="editUser" value="editUserForm.action">
									<s:param name="editUserForm" value="true" />
									<s:param name="userId" value="userId" />
								</s:url>
								<s:a href="%{editUser}">
									<s:property value="username" />
								</s:a>
							</td>
							<td><s:property value="firstName" /></td>
							<td><s:property value="secondName" /></td>
							<td><s:property value="email" /></td>
							<td><s:property value="phone" /></td>
							<td><s:property value="lastVisit" /></td>
							<td><s:url id="deleteUser" value="deleteUser.action">
								<s:param name="userId" value="userId" />
							</s:url> <s:a href="%{deleteUser}">Delete</s:a></td>
						</tr>
					</s:if>
					<s:else>
						<tr style="background-color: threedhighlight;">
							<td>
								<s:url id="editUser" value="editUserForm.action">
									<s:param name="editUserForm" value="true" />
									<s:param name="userId" value="userId" />
								</s:url>
								<s:a href="%{editUser}">
									<s:property value="username" />
								</s:a>
							</td>
							<td><s:property value="customerId" /></td>
							<td><s:property value="password" /></td>
							<td><s:url id="deleteUser" value="deleteUser.action">
								<s:param name="userId" value="userId" />
							</s:url> <s:a href="%{deleteUser}">Delete</s:a></td>
						</tr>
					</s:else>
				</s:iterator>
			</table>
		</s:if>
	</div>
</div>